home *** CD-ROM | disk | FTP | other *** search
/ Mac Action 1996 January / mac-action-07.iso / mac / Inside Action / Total Distortion Big Demo / aaShelf.Dxr / 00005_LibraryMan.script.ls < prev    next >
Encoding:
Text File  |  1995-06-05  |  2.4 KB  |  94 lines

  1. property MasterLibraryFLD, LibraryProxyLST, TopShelfMouseLST, BotShelfMouseLST, PsyShelfMouseLST, NowBookMark, NowBookMovie, NowBkEnterMark
  2.  
  3. on birth me
  4.   set MasterLibraryFLD to "MasterBookListFLD"
  5.   set temptext to field "ShelfMouseLSTs"
  6.   set PsyShelfMouseLST to value(line 6 of temptext)
  7.   BuildIndex(me)
  8.   return me
  9. end
  10.  
  11. on TopShelfClik me, MousH
  12.   repeat with x = 1 to count(TopShelfMouseLST)
  13.     set n to getAt(TopShelfMouseLST, x)
  14.     if MousH < n then
  15.       set BookNum to getPropAt(TopShelfMouseLST, x)
  16.       put BookNum
  17.       JumpShelf(me, BookNum)
  18.       exit
  19.     end if
  20.   end repeat
  21. end
  22.  
  23. on BotShelfClik me, MousH
  24.   repeat with x = 1 to count(BotShelfMouseLST)
  25.     set n to getAt(BotShelfMouseLST, x)
  26.     if MousH < n then
  27.       set BookNum to getPropAt(BotShelfMouseLST, x)
  28.       JumpShelf(me, BookNum)
  29.       exit
  30.     end if
  31.   end repeat
  32. end
  33.  
  34. on PsyShelfClik me, MousH
  35.   repeat with x = 1 to count(PsyShelfMouseLST)
  36.     set n to getAt(PsyShelfMouseLST, x)
  37.     if MousH < n then
  38.       set BookNum to getPropAt(PsyShelfMouseLST, x)
  39.       JumpShelf(me, BookNum)
  40.       exit
  41.     end if
  42.   end repeat
  43. end
  44.  
  45. on JumpShelf me, BookNum
  46.   set NowBookMark to item 3 of line BookNum of field MasterLibraryFLD
  47.   set NowBookMovie to NowBookMark
  48.   set NowBkEnterMark to item 4 of line BookNum of field MasterLibraryFLD
  49.   if NowBkEnterMark <> EMPTY then
  50.     set NowBkEnterMark to NowBkEnterMark
  51.   end if
  52.   go(NowBookMark & NowBkEnterMark)
  53. end
  54.  
  55. on JumpToBook me
  56.   if NowBkEnterMark <> EMPTY then
  57.     go(NowBkEnterMark, NowBookMovie)
  58.   else
  59.     go(1, NowBookMovie)
  60.   end if
  61. end
  62.  
  63. on BuildIndex me
  64.   set MasterDB to field "MasterBookListFLD"
  65.   set LibraryProxyLST to []
  66.   set BookListTEXT to item 2 of line 1 of MasterDB & RETURN
  67.   add(LibraryProxyLST, line 1 of MasterDB)
  68.   repeat with x = 2 to the number of lines in MasterDB
  69.     set titleString to item 2 of line x of MasterDB
  70.     if titleString <> "IndexBook" then
  71.       put titleString & RETURN after BookListTEXT
  72.       add(LibraryProxyLST, line x of MasterDB)
  73.     end if
  74.   end repeat
  75.   put BookListTEXT into field "IndexListFLD"
  76. end
  77.  
  78. on IndexFieldClik me, MousLin
  79.   if MousLin = -1 then
  80.     exit
  81.   end if
  82.   if line MousLin of field "IndexListFLD" = EMPTY then
  83.     exit
  84.   end if
  85.   set LineTX to getAt(LibraryProxyLST, MousLin)
  86.   set NowBookMark to item 3 of LineTX
  87.   set NowBookMovie to NowBookMark
  88.   set NowBkEnterMark to item 4 of LineTX
  89.   if NowBkEnterMark <> EMPTY then
  90.     set NowBkEnterMark to NowBkEnterMark
  91.   end if
  92.   go(NowBookMark & NowBkEnterMark)
  93. end
  94.